package service.impl;

import dao.UserDao;
import dao.impl.UserDaoImpl;
import factory.UserDaoFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.ImportResource;
import org.springframework.stereotype.Service;
import pojo.User;
import service.UserService;
@Service("userService")
public class UserServiceImpl implements UserService {
  private UserDao userDao;

  private int save2(User user) {
    return dao.saveUser(user);
  }

  @Autowired(required=false)
  private UserDao dao;

  public void save1(User user) {
    dao.saveUser(user);
  }
@Resource
  private UserDao dao1;
  @Override
  public void save(User user) {
    userDao.saveUser(user);
  }

  public void setUserDao(UserDao userDao) {
    this.userDao = userDao;
  }
  public UserServiceImpl(){}
  public UserServiceImpl(UserDao userDao) {
    this.userDao = userDao;
  }

  //  private UserDao dao=new UserDaoImpl();
 /* private UserDao dao= UserDaoFactory.getlnstance();
    @Override
    public void save(User user) {
        dao.save(user);
    }*/
}
